package com.changgou.goods.dao;

import com.changgou.goods.pojo.Brand;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
@Repository
public interface BrandMapper extends Mapper<Brand> {

    /**
     * 根据分类分类名称查询品牌
     * */
    @Select("SELECT * FROM tb_brand tb , tb_category tc , tb_category_brand tcb WHERE tb.id = tcb.brand_id AND tc.id = tcb.category_id AND tc.name =#{cateName}")
    List<Brand> findBrandByCateName(String cateName);
}
